#!/usr/bin/env python 
# -*- coding:utf-8 -*-
"""
@Time:2022/2/13 4:46 下午"
@Author:lydia_liu"
@File:Utils.py
@function: 读取yaml文件的类
"""
from jsonpath import jsonpath
from ruamel import yaml


class Utils:
    @classmethod
    def read_yaml(cls,file_path):

        with open(file_path) as f:

            datas = yaml.safe_load(f)
            return datas

    @classmethod
    def base_jsonpath(cls,obj,expr):
        """
        封装jsonpath断言
        :param obj:要断言的响应内容
        :param expr:jsonpath表达式
        :return:提交的列表
        """
        return jsonpath(obj,expr)